package com.netflexitysolutions.amazonws.ec2.internal.operations;

import com.amazonaws.ec2.doc._2009_04_04.CancelBundleTaskType;
import com.netflexitysolutions.amazonws.ec2.BundleInstanceInfo;
import com.netflexitysolutions.amazonws.ec2.EC2;
import com.netflexitysolutions.amazonws.ec2.internal.ModelUtil;

public class CancelBundleTaskOperation extends SingleObjectOperationExecutor<CancelBundleTaskType, BundleInstanceInfo> {

	public CancelBundleTaskOperation(EC2 ec2, String bundleId) {
		super(ec2, bundleId);
	}

	@Override
	protected BundleInstanceInfo call(CancelBundleTaskType request) {
		request.setBundleId(objectId);
		return ModelUtil.toDomainType(getEC2().getService().cancelBundleTask(request).getBundleInstanceTask());
	}

}
